package top.aicats.pattern.singleton.lazySingleton;


public class LazyInnerClassSingleton {
    private LazyInnerClassSingleton(){}


    public static LazyInnerClassSingleton getInstance()
    {
        return LazyHolderClass.LAZY;
    }
    // 静态内部类只有在外部类第一次使用的时候才会被初始化，因此属于懒汉式
    private static class LazyHolderClass {
        private static final LazyInnerClassSingleton LAZY = new LazyInnerClassSingleton();
    }
}
